﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
namespace Bystd.Geo.GeoParsers.Parser
{
    using Geometries;
    using Converters;
    using Bystd.Geo.GeoParsers.Wkb;

    public class WkbParser
    {
        public WkbParser()
        {  }

        public Geometry FromReader(byte[] buffer, int offset = 0)
        {
            using (GeometryReader reader = new GeometryReader(buffer, offset))
                return reader.Reader();
        }

        public byte[] ToWriter(Geometry geometry)
        {
            using (GeometryWriter writer = new GeometryWriter())
            {
                return writer.Writer(geometry);
            }
        }
    }
}
